package cn.itsource.smartcampus.controller;

import cn.itsource.smartcampus.domain.Student;
import cn.itsource.smartcampus.service.StudentService;
import cn.itsource.smartcampus.util.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.LinkedHashMap;
import java.util.List;
@RestController
@RequestMapping("/stu")
public class StudentController {

    @Autowired
    private StudentService studentService;
    /**
     * 查询全部老师的信息
     * @return
     */
    @GetMapping
    public AjaxResult getAll(){
        List<Student> all = studentService.getAll();
        for (Student student : all) {
            student.getSId();
        }
        /*LinkedHashMap<String, Object> map = new LinkedHashMap<>();
        map.put()*/
        return AjaxResult.ok(all);
    }
}
